1. Field of the Invention
The invention relates in general to a testing method and testing apparatus, and more particularly, to a testing method and testing apparatus suitable for different user interfaces and different hardware statuses.
2. Description of the Related Art
An electronic apparatus tends to offer versatile functions with modern technology development. It is therefore a critical task for manufacturers to test the various functions to ensure that the electronic apparatus achieve the precise functions. Tests are usually performed with a test program, commonly referred to as a test script. For example, to test an outgoing call dialing function of a telephone, a command is sent (from a testing apparatus) to an electronic apparatus to be tested to command the electronic apparatus to make a phone call (or to simulate a dialing operation instead of making a real phone call). The electronic apparatus sends a response according to an execution condition of the function to be tested, and the testing apparatus then determines whether the function is functional according to the response.
Current testing methods are usually implemented to only user interfaces with static icons. FIG. 1 shows a schematic diagram of a user interface on a cell phone. As shown in FIG. 1, a screen 101 of a cell phone 100 displays a user interface, which includes icons 103, 105, 107 and 109, respectively representing functions of messages, a calendar, photos and tools.
The user interface shown in FIG. 1 and the associated functions may be described by an extensible markup language (XML) or other similar markup languages. FIG. 2 shows details of a function to be tested describing a user interface and functions of the user interface by XML. Each window has a dedicated window ID for determining functions defined in the window and for describing a type of a current window. For example, a contact list window may include functions such as “categorize by group” and “categorize by phone book”. The program language in a program block 200 describes a function list of the window, i.e., the functions supported by the window, and the program language in a program block 201 describes operations of the functions in the window. Other details in FIG. 2 are known for those skilled in the art, and shall be omitted herein.
In a test process, each function has a corresponding test program. However, in the prior art, a test program written for the interface in FIG. 1, due to the deficiency of learning dynamic locations of the icons corresponding to the functions, can only be applied to the interface having static icons shown in FIG. 1. For example, the icon 103 represents the function of messages and the icon 109 represents the function of tools. In the event that the locations of the icons 103 and 109 are exchanged, corresponding changes should be first made to the test messages and the test programs of the test tool before testing or else an error will be incurred during the test process.
Moreover, a conventional testing method does not usually take dynamic hardware statuses into consideration. FIG. 3 shows a schematic diagram of a program to be tested describing a hardware status of an electronic apparatus to be tested using the XML. A program block 300 represents a hardware status of the electronic apparatus to be tested, and can be dynamically updated during the test process. For example, it means the electronic apparatus to be tested supports a touch function when “Touch_screen” equals “Yes”, and the electronic apparatus to be tested supports a keyboard function when “Key_Pad” equals “Yes”. Further, statuses of accessories or peripheral devices connected to the cell phone, such as a subscriber identity module (SIM) card, a memory card and earphones, can also be defined by the program block 300.
However, as previously stated, conventional testing methods usually do not take hardware statuses into consideration, and so unnecessary errors are often incurred. Taking the cell phone in FIG. 1 as an example, the cell phone can be inserted with an additional hardware device such as a SIM card or a memory card, and a testing staff may then need to perform certain tests on hardware access or other functions. In a situation that the hardware device is not inserted into the cell phone, a test command may still be sent such that an error message is generated due to continual lack of response to even lead to a stall or crash of the testing apparatus. In addition, a storage device such as a memory card may have drastically different file distributions or folder distributions, and so the conventional testing methods may need to sequentially change the test programs in response to the different file or folder distributions.
Therefore, it is obvious from the above discussions that, since test programs of conventional testing methods and testing apparatuses need to be constantly changed in situations where a user interface or hardware statuses are frequently varied, extra time and costs are required.